package com.qianyucc.blog.model.enums;

/**
 * @author lijing
 * @date 2019-10-12 10:30
 * @description 全局错误码
 */
public enum RespCode {
    TOKEN_EXPIRED(10001L, "token已过期"),
    IMAGE_UPLOAD_ERROR(10002L, "图片上传失败"),
    NOT_ADMIN_USER(10003L, "非管理员用户操作"),
    UNKNOWN_ERROR(50000L, "出现未知错误"),
    SUCCESS(20000L, "操作成功"),
    RESOURCES_NOT_FOUND(40004L, "找不到相应资源"),
    MISSING_PARAMETERS(40005L, "缺少参数"),
    ARTICLE_NOT_FOUND(10004L, "找不到对应文章"),
    INCOMPLETE_PARAMETERS(10005L, "请求字段不完整"),
    UN_INIT(10006L, "博客尚未初始化"),
    INVALID_LOGIN_TYPE(10007L, "非法登录类型");

    private Long code;
    private String message;

    public String getMessage() {
        return message;
    }

    RespCode(Long code, String message) {
        this.code = code;
        this.message = message;
    }

    public Long getCode() {
        return code;
    }
}
